import React, { useState } from 'react'

function useStateDome() {
    // const obj = useState(0)
    // obj是一个数组，下面通过解构赋值吧值和设置这个值的方法解构出来
    const [count, setCount] = useState(0)
    // useState不能存在于条件判断中
    return (
        <>
            <p>useState</p>
            <div>{count}</div>
            <button onClick={() => { setCount(count + 1) }}>click</button>
        </>
    )
}

export default useStateDome;